package com.atguigu.gmall.realtime.test;

import com.atguigu.gmall.realtime.app.BaseSQLApp;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.Table;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;

/**
 * @Author lzc
 * @Date 2022/5/8 21:48
 */
public class TimeZone1 extends BaseSQLApp {
    public static void main(String[] args) {
        new TimeZone1().init("LeftJoinRead1", 3000, 1, "LeftJoinRead1");
    }
    
    @Override
    public void handle(StreamExecutionEnvironment env,
                       StreamTableEnvironment tEnv) {
        Table t1 = tEnv.sqlQuery("select current_row_timestamp()");
        tEnv.toDataStream(t1).print();
        /*try {
            Thread.sleep(300);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
        Table t2 = tEnv.sqlQuery("select current_row_timestamp()");
        tEnv.toDataStream(t2).print();
    
        try {
            env.execute();
        } catch (Exception e) {
            e.printStackTrace();
        }
    
    
    }
}
